#include // Define the servo object Servo myServo; // Define the pin for the servo signal const int servoPin = 2; // Change to the PWM-capable pin you are using void setup() { // Attach the servo to the defined pin myServo.attach(servoPin); } void loop() { // Rotate the servo to 0 degrees myServo.write(0); delay(1000); // Wait for 1 second // Rotate the servo to 90 degrees myServo.write(90); delay(1000); // Wait for 1 second // Rotate the servo to 180 degrees myServo.write(180); delay(1000); // Wait for 1 second }